<template>
  <view
    class="content"
    :style="{
      'padding-top': height + 'px',
    }"
  >
    <view
      :style="{
        height: statusBarHeight + 'px',
      }"
    >
    </view>
    <!-- 头部 -->
    <view
      class="head"
      :style="{
        top: statusBarHeight + 'px',
        background: isHeadBack ? 'rgba(0,0,0,0.3)' : 'rgba(0,0,0,0)',
      }"
    >
      <view class="head_left">
        <u-icon
          name="arrow-left"
          color="#EEEEEE"
          size="24"
          :bold="true"
          @click="toBack"
        ></u-icon>
      </view>
      <view class="text">我的钱包</view>
    </view>

    <view class="box">
      <view class="box_card">
        <view class="box_card_title">我的资产（人民币）</view>
        <view class="box_card_price" @click="goYu">
          <view class="box_card_price_unit">￥</view>
          <view class="box_card_price_num">{{ assets.balance }}</view>
        </view>
        <view class="box_card_bot">
          <view class="box_card_btn" @click="goPage">提现</view>
        </view>
      </view>

      <view class="box_title">其他资产</view>

      <view class="box_bot">
        <view class="box_bot_item" @click="goIntegral">
          <view class="box_bot_item_title">积分</view>
          <view class="box_bot_item_num">
            <view class="box_bot_item_num_left">{{ assets.integral }}</view>
            <u-icon name="arrow-right" color="#888888" size="15"></u-icon>
          </view>
        </view>

        <view class="box_bot_item" @click="goNiuLe">
          <view class="box_bot_item_title">牛勒</view>
          <view class="box_bot_item_num">
            <view class="box_bot_item_num_left">{{ assets.niule }}</view>
            <u-icon name="arrow-right" color="#888888" size="15"></u-icon>
          </view>
        </view>
      </view>

      <view class="bottom_btn" @click="goWallet">兑换</view>

      <view class="handle_text">
        {{shuomingText}}
      </view>
    </view>

    <floatingBall></floatingBall>
  </view>
</template>
        
        <script>
export default {
  components: {},

  data() {
    return {
      statusBarHeight: 0,
      height: 0,
      isHeadBack: false,
      assets: {},
      shuomingText:''
    };
  },
  created() {
    const statusBarHeight = uni.getSystemInfoSync(); // 获取手机状态栏高度

    this.statusBarHeight = statusBarHeight.statusBarHeight;
    this.$nextTick(() => {
      uni
        .createSelectorQuery()
        .select(".head")
        .boundingClientRect((data) => {
          this.height = data.height;
        })
        .exec();
    });
    this.getAssets();
    this.getShuoMing()
  },
  methods: {
    getShuoMing(){
      this.$http
        .appversionTixian({})
        .then((res) => {
          // console.log(res.data.tixian.content, "体现说明");
          this.shuomingText = res.data.tixian.content
          // this.assets = res.data.assets;
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    toBack() {
      uni.navigateBack({
        delta: 1,
      });
    },
    goPage() {
      console.log(1111111111);
      uni.navigateTo({
        url: "/pages/integral/Withdrawal",
      });
    },
    goWallet() {
      uni.navigateTo({
        url: "/pages/integral/code",
      });
    },
    // 积分明细
    goIntegral() {
      uni.navigateTo({
        url: `/pages/integral/codeRecord?title=积分明细&type=3`,
      });
    },
    // 牛勒明细
    goNiuLe() {
      uni.navigateTo({
        url: `/pages/integral/codeRecord?title=牛勒明细&type=2`,
      });
    },
    // 余额明细
    goYu() {
      uni.navigateTo({
        url: `/pages/integral/codeRecord?title=余额明细&type=4`,
      });
    },
    // 账户钱包余额
    getAssets() {
      this.$http
        .userAssets({})
        .then((res) => {
          console.log(res.data.assets, "账户钱包余额");
          this.assets = res.data.assets;
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
  },
};
</script>
        
        <style scoped lang="scss">
.content {
  background: #111111;
  box-sizing: border-box;
  // background: url("/static/images/my/pic_wdjf_bwijing.png") no-repeat;
  // background-size: 100% auto;
  // background-attachment: fixed;
  z-index: -10;
  display: flex;
  flex-direction: column;
}

.head {
  width: 100%;
  padding: 18rpx 30rpx 47rpx;
  position: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  z-index: 99;
  background: #ffffff;
  .head_left {
    position: absolute;
    left: 30rpx;
  }

  .head_right {
    position: absolute;
    right: 30rpx;
    color: #ffffff;
    font-size: 30rpx;
  }

  .text {
    font-size: 36rpx;
    font-family: PingFang SC-Bold, PingFang SC;
    font-weight: 400;
    color: #eeeeee;
  }
}
.box {
  padding: 30rpx;
  .box_card {
    background: url("/static/images/my/pic-wdqb_qianbao.png") no-repeat;
    background-size: 100% 100%;
    padding: 53rpx 40rpx;
    box-sizing: border-box;
    .box_card_title {
      font-size: 24rpx;
      color: #666666;
    }
    .box_card_price {
      color: #272727;
      margin-top: 16rpx;
      .box_card_price_unit {
        font-size: 40rpx;
        display: inline-block;
      }
      .box_card_price_num {
        font-size: 60rpx;
        display: inline-block;
      }
    }
    .box_card_bot {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      margin-top: 25rpx;
      .box_card_btn {
        width: 180rpx;
        height: 64rpx;
        background: linear-gradient(
          180deg,
          #5aaf91 0%,
          rgba(90, 175, 145, 0.48) 100%
        );
        border-radius: 32rpx;
        font-size: 28rpx;
        color: #ffffff;
        text-align: center;
        line-height: 64rpx;
      }
    }
  }
  .box_title {
    font-size: 32rpx;
    color: #ffffff;
    margin-top: 40rpx;
  }

  .box_bot {
    margin-top: 24rpx;
    display: flex;
    align-items: center;
    justify-content: space-between;
    .box_bot_item {
      width: 335rpx;
      background: #272727;
      border-radius: 24rpx;
      padding: 32rpx;
      box-sizing: border-box;
      .box_bot_item_title {
        font-size: 24rpx;
        color: #888888;
      }
      .box_bot_item_num {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 17rpx;
        .box_bot_item_num_left {
          font-size: 36rpx;
          color: #ffffff;
        }
      }
    }
  }
  .bottom_btn {
    width: 630rpx;
    height: 96rpx;
    background: linear-gradient(360deg, #50b674 0%, #aeddbd 100%);
    border-radius: 48rpx;
    text-align: center;
    line-height: 96rpx;
    font-size: 30rpx;
    color: #ffffff;
    margin: 0 auto;
    margin-top: 96rpx;
  }
  .handle_text {
			width: 100%;
			font-size: 26rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			color: #888888;
			line-height: 42rpx;
			// padding: 0 30rpx;
			box-sizing: border-box;
			margin-top: 32rpx;
		}
}
</style>